import { Moment } from 'moment';

export const enum OrderStatus {
    NEW = 'NEW',
    REQUEST_VALID = 'REQUEST_VALID',
    OFFER_VALID = 'OFFER_VALID',
    RECEIVED = 'RECEIVED',
    DELIVERED = 'DELIVERED',
    ACCEPTED = 'ACCEPTED',
    COMMENTED = 'COMMENTED'
}

export interface IDeliverOrder {
    id?: number;
    requestId?: number;
    requestUserId?: number;
    offerUserId?: number;
    from?: string;
    to?: string;
    goodsType?: string;
    goodsWeight?: string;
    goodsDesc?: string;
    price?: number;
    status?: OrderStatus;
    createdDate?: Moment;
    requestValidDate?: Moment;
    validDate?: Moment;
    receiveDate?: Moment;
    deliveredDate?: Moment;
    acceptDate?: Moment;
    commentDate?: Moment;
    cancelDate?: Moment;
}

export class DeliverOrder implements IDeliverOrder {
    constructor(
        public id?: number,
        public requestId?: number,
        public requestUserId?: number,
        public offerUserId?: number,
        public from?: string,
        public to?: string,
        public goodsType?: string,
        public goodsWeight?: string,
        public goodsDesc?: string,
        public price?: number,
        public status?: OrderStatus,
        public createdDate?: Moment,
        public requestValidDate?: Moment,
        public validDate?: Moment,
        public receiveDate?: Moment,
        public deliveredDate?: Moment,
        public acceptDate?: Moment,
        public commentDate?: Moment,
        public cancelDate?: Moment
    ) {}
}
